<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of RegisterForm
 *
 * @author COMPAQ
 */
class RegisterForm extends sfGuardRegisterForm{
    //put your code here
   /**
   * @see sfForm
   */
  public function configure()
  {
	//configurations des types de champ
	$this->widgetSchema['userimage'] = new sfWidgetFormInputFileEditable(array(
		'label'			=> 'Photo',
		'file_src'		=> '/uploads/user/'.$this->getObject()->getUserimage(),
		'is_image'		=> true,
		'edit_mode'		=> !$this->isNew(),
		'template'		=> '<div>%file%<br /><br /><br />%input%<br /><br /><div>%delete% %delete_label%</div></div>',
	));
	//genere lec champ captcha sur notre site
	$this->widgetSchema['captcha'] = new sfWidgetCaptchaGD(array(
		'label'			=> 'Captcha',
	));
	
	$this->validatorSchema['image_delete'] = new sfValidatorBoolean();

	$this->validatorSchema['userimage'] = new sfValidatorFile(array(
	  'required'   => false,
	  'path'       => sfConfig::get('sf_upload_dir').'/user',
	  'mime_types' => 'web_images',
	));
	
	//validateur du captcha
/*	$this->validatorSchema->setPostValidator(
      new sfAnotherValidatorSchemaReCaptcha($this, 'captcha')
    );*/
	$this->validatorSchema['captcha'] = new sfCaptchaGDValidator();
  }
}

?>
